//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2021 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto/tree/main/CodeGenerator. DO NOT EDIT.

import Foundation
import SotoCore

extension CodeGuruReviewer {
    // MARK: Enums

    public enum JobState: String, CustomStringConvertible, Codable {
        case completed = "Completed"
        case deleting = "Deleting"
        case failed = "Failed"
        case pending = "Pending"
        public var description: String { return self.rawValue }
    }

    public enum ProviderType: String, CustomStringConvertible, Codable {
        case bitbucket = "Bitbucket"
        case codecommit = "CodeCommit"
        case github = "GitHub"
        case githubenterpriseserver = "GitHubEnterpriseServer"
        public var description: String { return self.rawValue }
    }

    public enum Reaction: String, CustomStringConvertible, Codable {
        case thumbsdown = "ThumbsDown"
        case thumbsup = "ThumbsUp"
        public var description: String { return self.rawValue }
    }

    public enum RepositoryAssociationState: String, CustomStringConvertible, Codable {
        case associated = "Associated"
        case associating = "Associating"
        case disassociated = "Disassociated"
        case disassociating = "Disassociating"
        case failed = "Failed"
        public var description: String { return self.rawValue }
    }

    public enum `Type`: String, CustomStringConvertible, Codable {
        case pullrequest = "PullRequest"
        case repositoryanalysis = "RepositoryAnalysis"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AssociateRepositoryRequest: AWSEncodableShape {
        /// Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate repository associations if there are failures and retries.
        public let clientRequestToken: String?
        /// The repository to associate.
        public let repository: Repository
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]?

        public init(clientRequestToken: String? = AssociateRepositoryRequest.idempotencyToken(), repository: Repository, tags: [String: String]? = nil) {
            self.clientRequestToken = clientRequestToken
            self.repository = repository
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[\\w-]+$")
            try self.repository.validate(name: "\(name).repository")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case repository = "Repository"
            case tags = "Tags"
        }
    }

    public struct AssociateRepositoryResponse: AWSDecodableShape {
        /// Information about the repository association.
        public let repositoryAssociation: RepositoryAssociation?
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]?

        public init(repositoryAssociation: RepositoryAssociation? = nil, tags: [String: String]? = nil) {
            self.repositoryAssociation = repositoryAssociation
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryAssociation = "RepositoryAssociation"
            case tags = "Tags"
        }
    }

    public struct CodeCommitRepository: AWSEncodableShape {
        /// The name of the AWS CodeCommit repository. For more information, see repositoryName in the AWS CodeCommit API Reference.
        public let name: String

        public init(name: String) {
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^\\S[\\w.-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case name = "Name"
        }
    }

    public struct CodeReview: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  that contains the reviewed source code. You can retrieve associated repository ARNs by calling  ListRepositoryAssociations .
        public let associationArn: String?
        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String?
        ///  The time, in milliseconds since the epoch, when the code review was created.
        public let createdTimeStamp: Date?
        ///  The time, in milliseconds since the epoch, when the code review was last updated.
        public let lastUpdatedTimeStamp: Date?
        ///  The statistics from the code review.
        public let metrics: Metrics?
        ///  The name of the code review.
        public let name: String?
        /// The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository.
        public let owner: String?
        ///  The type of repository that contains the reviewed code (for example, GitHub or Bitbucket).
        public let providerType: ProviderType?
        ///  The pull request ID for the code review.
        public let pullRequestId: String?
        ///  The name of the repository.
        public let repositoryName: String?
        ///  The type of the source code for the code review.
        public let sourceCodeType: SourceCodeType?
        /// The valid code review states are:    Completed: The code review is complete.     Pending: The code review started and has not completed or failed.     Failed: The code review failed.     Deleting: The code review is being deleted.
        public let state: JobState?
        ///  The reason for the state of the code review.
        public let stateReason: String?
        ///  The type of code review.
        public let type: `Type`?

        public init(associationArn: String? = nil, codeReviewArn: String? = nil, createdTimeStamp: Date? = nil, lastUpdatedTimeStamp: Date? = nil, metrics: Metrics? = nil, name: String? = nil, owner: String? = nil, providerType: ProviderType? = nil, pullRequestId: String? = nil, repositoryName: String? = nil, sourceCodeType: SourceCodeType? = nil, state: JobState? = nil, stateReason: String? = nil, type: `Type`? = nil) {
            self.associationArn = associationArn
            self.codeReviewArn = codeReviewArn
            self.createdTimeStamp = createdTimeStamp
            self.lastUpdatedTimeStamp = lastUpdatedTimeStamp
            self.metrics = metrics
            self.name = name
            self.owner = owner
            self.providerType = providerType
            self.pullRequestId = pullRequestId
            self.repositoryName = repositoryName
            self.sourceCodeType = sourceCodeType
            self.state = state
            self.stateReason = stateReason
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case associationArn = "AssociationArn"
            case codeReviewArn = "CodeReviewArn"
            case createdTimeStamp = "CreatedTimeStamp"
            case lastUpdatedTimeStamp = "LastUpdatedTimeStamp"
            case metrics = "Metrics"
            case name = "Name"
            case owner = "Owner"
            case providerType = "ProviderType"
            case pullRequestId = "PullRequestId"
            case repositoryName = "RepositoryName"
            case sourceCodeType = "SourceCodeType"
            case state = "State"
            case stateReason = "StateReason"
            case type = "Type"
        }
    }

    public struct CodeReviewSummary: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String?
        ///  The time, in milliseconds since the epoch, when the code review was created.
        public let createdTimeStamp: Date?
        ///  The time, in milliseconds since the epoch, when the code review was last updated.
        public let lastUpdatedTimeStamp: Date?
        ///  The statistics from the code review.
        public let metricsSummary: MetricsSummary?
        ///  The name of the code review.
        public let name: String?
        /// The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository.
        public let owner: String?
        ///  The provider type of the repository association.
        public let providerType: ProviderType?
        ///  The pull request ID for the code review.
        public let pullRequestId: String?
        ///  The name of the repository.
        public let repositoryName: String?
        ///  The state of the code review.  The valid code review states are:    Completed: The code review is complete.     Pending: The code review started and has not completed or failed.     Failed: The code review failed.     Deleting: The code review is being deleted.
        public let state: JobState?
        ///  The type of the code review.
        public let type: `Type`?

        public init(codeReviewArn: String? = nil, createdTimeStamp: Date? = nil, lastUpdatedTimeStamp: Date? = nil, metricsSummary: MetricsSummary? = nil, name: String? = nil, owner: String? = nil, providerType: ProviderType? = nil, pullRequestId: String? = nil, repositoryName: String? = nil, state: JobState? = nil, type: `Type`? = nil) {
            self.codeReviewArn = codeReviewArn
            self.createdTimeStamp = createdTimeStamp
            self.lastUpdatedTimeStamp = lastUpdatedTimeStamp
            self.metricsSummary = metricsSummary
            self.name = name
            self.owner = owner
            self.providerType = providerType
            self.pullRequestId = pullRequestId
            self.repositoryName = repositoryName
            self.state = state
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case codeReviewArn = "CodeReviewArn"
            case createdTimeStamp = "CreatedTimeStamp"
            case lastUpdatedTimeStamp = "LastUpdatedTimeStamp"
            case metricsSummary = "MetricsSummary"
            case name = "Name"
            case owner = "Owner"
            case providerType = "ProviderType"
            case pullRequestId = "PullRequestId"
            case repositoryName = "RepositoryName"
            case state = "State"
            case type = "Type"
        }
    }

    public struct CodeReviewType: AWSEncodableShape {
        ///  A code review that analyzes all code under a specified branch in an associated respository. The assocated repository is specified using its ARN in  CreateCodeReview .
        public let repositoryAnalysis: RepositoryAnalysis

        public init(repositoryAnalysis: RepositoryAnalysis) {
            self.repositoryAnalysis = repositoryAnalysis
        }

        public func validate(name: String) throws {
            try self.repositoryAnalysis.validate(name: "\(name).repositoryAnalysis")
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryAnalysis = "RepositoryAnalysis"
        }
    }

    public struct CommitDiffSourceCodeType: AWSDecodableShape {
        ///  The SHA of the destination commit used to generate a commit diff.
        public let destinationCommit: String?
        ///  The SHA of the source commit used to generate a commit diff.
        public let sourceCommit: String?

        public init(destinationCommit: String? = nil, sourceCommit: String? = nil) {
            self.destinationCommit = destinationCommit
            self.sourceCommit = sourceCommit
        }

        private enum CodingKeys: String, CodingKey {
            case destinationCommit = "DestinationCommit"
            case sourceCommit = "SourceCommit"
        }
    }

    public struct CreateCodeReviewRequest: AWSEncodableShape {
        ///  Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.
        public let clientRequestToken: String?
        ///  The name of the code review. The name of each code review in your AWS account must be unique.
        public let name: String
        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .   A code review can only be created on an associated repository. This is the ARN of the associated repository.
        public let repositoryAssociationArn: String
        ///  The type of code review to create. This is specified using a  CodeReviewType  object. You can create a code review only of type RepositoryAnalysis.
        public let type: CodeReviewType

        public init(clientRequestToken: String? = CreateCodeReviewRequest.idempotencyToken(), name: String, repositoryAssociationArn: String, type: CodeReviewType) {
            self.clientRequestToken = clientRequestToken
            self.name = name
            self.repositoryAssociationArn = repositoryAssociationArn
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, max: 64)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, min: 1)
            try self.validate(self.clientRequestToken, name: "clientRequestToken", parent: name, pattern: "^[\\w-]+$")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "[a-zA-Z0-9-_]*")
            try self.validate(self.repositoryAssociationArn, name: "repositoryAssociationArn", parent: name, max: 1600)
            try self.validate(self.repositoryAssociationArn, name: "repositoryAssociationArn", parent: name, min: 1)
            try self.validate(self.repositoryAssociationArn, name: "repositoryAssociationArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.type.validate(name: "\(name).type")
        }

        private enum CodingKeys: String, CodingKey {
            case clientRequestToken = "ClientRequestToken"
            case name = "Name"
            case repositoryAssociationArn = "RepositoryAssociationArn"
            case type = "Type"
        }
    }

    public struct CreateCodeReviewResponse: AWSDecodableShape {
        public let codeReview: CodeReview?

        public init(codeReview: CodeReview? = nil) {
            self.codeReview = codeReview
        }

        private enum CodingKeys: String, CodingKey {
            case codeReview = "CodeReview"
        }
    }

    public struct DescribeCodeReviewRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "codeReviewArn", location: .uri(locationName: "CodeReviewArn"))
        ]

        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String

        public init(codeReviewArn: String) {
            self.codeReviewArn = codeReviewArn
        }

        public func validate(name: String) throws {
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, max: 1600)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, min: 1)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:[a-z-]+:[\\w-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeCodeReviewResponse: AWSDecodableShape {
        ///  Information about the code review.
        public let codeReview: CodeReview?

        public init(codeReview: CodeReview? = nil) {
            self.codeReview = codeReview
        }

        private enum CodingKeys: String, CodingKey {
            case codeReview = "CodeReview"
        }
    }

    public struct DescribeRecommendationFeedbackRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "codeReviewArn", location: .uri(locationName: "CodeReviewArn")),
            AWSMemberEncoding(label: "recommendationId", location: .querystring(locationName: "RecommendationId")),
            AWSMemberEncoding(label: "userId", location: .querystring(locationName: "UserId"))
        ]

        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String
        ///  The recommendation ID that can be used to track the provided recommendations and then to collect the feedback.
        public let recommendationId: String
        ///  Optional parameter to describe the feedback for a given user. If this is not supplied, it defaults to the user making the request.   The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see  Specifying a Principal in the AWS Identity and Access Management User Guide.
        public let userId: String?

        public init(codeReviewArn: String, recommendationId: String, userId: String? = nil) {
            self.codeReviewArn = codeReviewArn
            self.recommendationId = recommendationId
            self.userId = userId
        }

        public func validate(name: String) throws {
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, max: 1600)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, min: 1)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:[a-z-]+:[\\w-]+$")
            try self.validate(self.recommendationId, name: "recommendationId", parent: name, max: 64)
            try self.validate(self.recommendationId, name: "recommendationId", parent: name, min: 1)
            try self.validate(self.userId, name: "userId", parent: name, max: 256)
            try self.validate(self.userId, name: "userId", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeRecommendationFeedbackResponse: AWSDecodableShape {
        ///  The recommendation feedback given by the user.
        public let recommendationFeedback: RecommendationFeedback?

        public init(recommendationFeedback: RecommendationFeedback? = nil) {
            self.recommendationFeedback = recommendationFeedback
        }

        private enum CodingKeys: String, CodingKey {
            case recommendationFeedback = "RecommendationFeedback"
        }
    }

    public struct DescribeRepositoryAssociationRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "associationArn", location: .uri(locationName: "AssociationArn"))
        ]

        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let associationArn: String

        public init(associationArn: String) {
            self.associationArn = associationArn
        }

        public func validate(name: String) throws {
            try self.validate(self.associationArn, name: "associationArn", parent: name, max: 1600)
            try self.validate(self.associationArn, name: "associationArn", parent: name, min: 1)
            try self.validate(self.associationArn, name: "associationArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DescribeRepositoryAssociationResponse: AWSDecodableShape {
        /// Information about the repository association.
        public let repositoryAssociation: RepositoryAssociation?
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]?

        public init(repositoryAssociation: RepositoryAssociation? = nil, tags: [String: String]? = nil) {
            self.repositoryAssociation = repositoryAssociation
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryAssociation = "RepositoryAssociation"
            case tags = "Tags"
        }
    }

    public struct DisassociateRepositoryRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "associationArn", location: .uri(locationName: "AssociationArn"))
        ]

        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let associationArn: String

        public init(associationArn: String) {
            self.associationArn = associationArn
        }

        public func validate(name: String) throws {
            try self.validate(self.associationArn, name: "associationArn", parent: name, max: 1600)
            try self.validate(self.associationArn, name: "associationArn", parent: name, min: 1)
            try self.validate(self.associationArn, name: "associationArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociateRepositoryResponse: AWSDecodableShape {
        /// Information about the disassociated repository.
        public let repositoryAssociation: RepositoryAssociation?
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]?

        public init(repositoryAssociation: RepositoryAssociation? = nil, tags: [String: String]? = nil) {
            self.repositoryAssociation = repositoryAssociation
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryAssociation = "RepositoryAssociation"
            case tags = "Tags"
        }
    }

    public struct ListCodeReviewsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "MaxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "NextToken")),
            AWSMemberEncoding(label: "providerTypes", location: .querystring(locationName: "ProviderTypes")),
            AWSMemberEncoding(label: "repositoryNames", location: .querystring(locationName: "RepositoryNames")),
            AWSMemberEncoding(label: "states", location: .querystring(locationName: "States")),
            AWSMemberEncoding(label: "type", location: .querystring(locationName: "Type"))
        ]

        ///  The maximum number of results that are returned per call. The default is 100.
        public let maxResults: Int?
        ///  If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.
        public let nextToken: String?
        ///  List of provider types for filtering that needs to be applied before displaying the result. For example, providerTypes=[GitHub] lists code reviews from GitHub.
        public let providerTypes: [ProviderType]?
        ///  List of repository names for filtering that needs to be applied before displaying the result.
        public let repositoryNames: [String]?
        ///  List of states for filtering that needs to be applied before displaying the result. For example, states=[Pending] lists code reviews in the Pending state.  The valid code review states are:    Completed: The code review is complete.     Pending: The code review started and has not completed or failed.     Failed: The code review failed.     Deleting: The code review is being deleted.
        public let states: [JobState]?
        ///  The type of code reviews to list in the response.
        public let type: `Type`

        public init(maxResults: Int? = nil, nextToken: String? = nil, providerTypes: [ProviderType]? = nil, repositoryNames: [String]? = nil, states: [JobState]? = nil, type: `Type`) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.providerTypes = providerTypes
            self.repositoryNames = repositoryNames
            self.states = states
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.providerTypes, name: "providerTypes", parent: name, max: 3)
            try self.validate(self.providerTypes, name: "providerTypes", parent: name, min: 1)
            try self.repositoryNames?.forEach {
                try validate($0, name: "repositoryNames[]", parent: name, max: 100)
                try validate($0, name: "repositoryNames[]", parent: name, min: 1)
                try validate($0, name: "repositoryNames[]", parent: name, pattern: "^\\S[\\w.-]*$")
            }
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, max: 100)
            try self.validate(self.repositoryNames, name: "repositoryNames", parent: name, min: 1)
            try self.validate(self.states, name: "states", parent: name, max: 3)
            try self.validate(self.states, name: "states", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListCodeReviewsResponse: AWSDecodableShape {
        ///  A list of code reviews that meet the criteria of the request.
        public let codeReviewSummaries: [CodeReviewSummary]?
        ///  Pagination token.
        public let nextToken: String?

        public init(codeReviewSummaries: [CodeReviewSummary]? = nil, nextToken: String? = nil) {
            self.codeReviewSummaries = codeReviewSummaries
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case codeReviewSummaries = "CodeReviewSummaries"
            case nextToken = "NextToken"
        }
    }

    public struct ListRecommendationFeedbackRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "codeReviewArn", location: .uri(locationName: "CodeReviewArn")),
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "MaxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "NextToken")),
            AWSMemberEncoding(label: "recommendationIds", location: .querystring(locationName: "RecommendationIds")),
            AWSMemberEncoding(label: "userIds", location: .querystring(locationName: "UserIds"))
        ]

        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String
        ///  The maximum number of results that are returned per call. The default is 100.
        public let maxResults: Int?
        ///  If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.
        public let nextToken: String?
        ///  Used to query the recommendation feedback for a given recommendation.
        public let recommendationIds: [String]?
        ///  An AWS user's account ID or Amazon Resource Name (ARN). Use this ID to query the recommendation feedback for a code review from that user.   The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see  Specifying a Principal in the AWS Identity and Access Management User Guide.
        public let userIds: [String]?

        public init(codeReviewArn: String, maxResults: Int? = nil, nextToken: String? = nil, recommendationIds: [String]? = nil, userIds: [String]? = nil) {
            self.codeReviewArn = codeReviewArn
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.recommendationIds = recommendationIds
            self.userIds = userIds
        }

        public func validate(name: String) throws {
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, max: 1600)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, min: 1)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:[a-z-]+:[\\w-]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.recommendationIds?.forEach {
                try validate($0, name: "recommendationIds[]", parent: name, max: 64)
                try validate($0, name: "recommendationIds[]", parent: name, min: 1)
            }
            try self.validate(self.recommendationIds, name: "recommendationIds", parent: name, max: 100)
            try self.validate(self.recommendationIds, name: "recommendationIds", parent: name, min: 1)
            try self.userIds?.forEach {
                try validate($0, name: "userIds[]", parent: name, max: 256)
                try validate($0, name: "userIds[]", parent: name, min: 1)
            }
            try self.validate(self.userIds, name: "userIds", parent: name, max: 100)
            try self.validate(self.userIds, name: "userIds", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListRecommendationFeedbackResponse: AWSDecodableShape {
        ///  If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged.
        public let nextToken: String?
        ///  Recommendation feedback summaries corresponding to the code review ARN.
        public let recommendationFeedbackSummaries: [RecommendationFeedbackSummary]?

        public init(nextToken: String? = nil, recommendationFeedbackSummaries: [RecommendationFeedbackSummary]? = nil) {
            self.nextToken = nextToken
            self.recommendationFeedbackSummaries = recommendationFeedbackSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case recommendationFeedbackSummaries = "RecommendationFeedbackSummaries"
        }
    }

    public struct ListRecommendationsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "codeReviewArn", location: .uri(locationName: "CodeReviewArn")),
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "MaxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "NextToken"))
        ]

        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String
        ///  The maximum number of results that are returned per call. The default is 100.
        public let maxResults: Int?
        ///  Pagination token.
        public let nextToken: String?

        public init(codeReviewArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.codeReviewArn = codeReviewArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, max: 1600)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, min: 1)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:[a-z-]+:[\\w-]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListRecommendationsResponse: AWSDecodableShape {
        ///  Pagination token.
        public let nextToken: String?
        ///  List of recommendations for the requested code review.
        public let recommendationSummaries: [RecommendationSummary]?

        public init(nextToken: String? = nil, recommendationSummaries: [RecommendationSummary]? = nil) {
            self.nextToken = nextToken
            self.recommendationSummaries = recommendationSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case recommendationSummaries = "RecommendationSummaries"
        }
    }

    public struct ListRepositoryAssociationsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring(locationName: "MaxResults")),
            AWSMemberEncoding(label: "names", location: .querystring(locationName: "Name")),
            AWSMemberEncoding(label: "nextToken", location: .querystring(locationName: "NextToken")),
            AWSMemberEncoding(label: "owners", location: .querystring(locationName: "Owner")),
            AWSMemberEncoding(label: "providerTypes", location: .querystring(locationName: "ProviderType")),
            AWSMemberEncoding(label: "states", location: .querystring(locationName: "State"))
        ]

        /// The maximum number of repository association results returned by ListRepositoryAssociations in paginated output. When this parameter is used, ListRepositoryAssociations only returns maxResults results in a single page with a nextToken response element. The remaining results of the initial request can be seen by sending another ListRepositoryAssociations request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, ListRepositoryAssociations returns up to 100 results and a nextToken value if applicable.
        public let maxResults: Int?
        /// List of repository names to use as a filter.
        public let names: [String]?
        /// The nextToken value returned from a previous paginated ListRepositoryAssociations request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.   Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
        public let nextToken: String?
        /// List of owners to use as a filter. For AWS CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository.
        public let owners: [String]?
        /// List of provider types to use as a filter.
        public let providerTypes: [ProviderType]?
        /// List of repository association states to use as a filter. The valid repository association states are:    Associated: The repository association is complete.     Associating: CodeGuru Reviewer is:     Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.    If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.      Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.       Failed: The repository failed to associate or disassociate.     Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.     Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in an associated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.
        public let states: [RepositoryAssociationState]?

        public init(maxResults: Int? = nil, names: [String]? = nil, nextToken: String? = nil, owners: [String]? = nil, providerTypes: [ProviderType]? = nil, states: [RepositoryAssociationState]? = nil) {
            self.maxResults = maxResults
            self.names = names
            self.nextToken = nextToken
            self.owners = owners
            self.providerTypes = providerTypes
            self.states = states
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.names?.forEach {
                try validate($0, name: "names[]", parent: name, max: 100)
                try validate($0, name: "names[]", parent: name, min: 1)
                try validate($0, name: "names[]", parent: name, pattern: "^\\S[\\w.-]*$")
            }
            try self.validate(self.names, name: "names", parent: name, max: 3)
            try self.validate(self.names, name: "names", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.owners?.forEach {
                try validate($0, name: "owners[]", parent: name, max: 100)
                try validate($0, name: "owners[]", parent: name, min: 1)
                try validate($0, name: "owners[]", parent: name, pattern: "^\\S(.*\\S)?$")
            }
            try self.validate(self.owners, name: "owners", parent: name, max: 3)
            try self.validate(self.owners, name: "owners", parent: name, min: 1)
            try self.validate(self.providerTypes, name: "providerTypes", parent: name, max: 3)
            try self.validate(self.providerTypes, name: "providerTypes", parent: name, min: 1)
            try self.validate(self.states, name: "states", parent: name, max: 5)
            try self.validate(self.states, name: "states", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListRepositoryAssociationsResponse: AWSDecodableShape {
        /// The nextToken value to include in a future ListRecommendations request. When the results of a ListRecommendations request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.
        public let nextToken: String?
        /// A list of repository associations that meet the criteria of the request.
        public let repositoryAssociationSummaries: [RepositoryAssociationSummary]?

        public init(nextToken: String? = nil, repositoryAssociationSummaries: [RepositoryAssociationSummary]? = nil) {
            self.nextToken = nextToken
            self.repositoryAssociationSummaries = repositoryAssociationSummaries
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case repositoryAssociationSummaries = "RepositoryAssociationSummaries"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]?

        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct Metrics: AWSDecodableShape {
        ///  Total number of recommendations found in the code review.
        public let findingsCount: Int64?
        ///  Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code for a total of 2,725 lines of code.
        public let meteredLinesOfCodeCount: Int64?

        public init(findingsCount: Int64? = nil, meteredLinesOfCodeCount: Int64? = nil) {
            self.findingsCount = findingsCount
            self.meteredLinesOfCodeCount = meteredLinesOfCodeCount
        }

        private enum CodingKeys: String, CodingKey {
            case findingsCount = "FindingsCount"
            case meteredLinesOfCodeCount = "MeteredLinesOfCodeCount"
        }
    }

    public struct MetricsSummary: AWSDecodableShape {
        ///  Total number of recommendations found in the code review.
        public let findingsCount: Int64?
        ///  Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, MeteredLinesOfCodeCount includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of code for a total of 2,725 lines of code.
        public let meteredLinesOfCodeCount: Int64?

        public init(findingsCount: Int64? = nil, meteredLinesOfCodeCount: Int64? = nil) {
            self.findingsCount = findingsCount
            self.meteredLinesOfCodeCount = meteredLinesOfCodeCount
        }

        private enum CodingKeys: String, CodingKey {
            case findingsCount = "FindingsCount"
            case meteredLinesOfCodeCount = "MeteredLinesOfCodeCount"
        }
    }

    public struct PutRecommendationFeedbackRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String
        ///  List for storing reactions. Reactions are utf-8 text code for emojis. If you send an empty list it clears all your feedback.
        public let reactions: [Reaction]
        ///  The recommendation ID that can be used to track the provided recommendations and then to collect the feedback.
        public let recommendationId: String

        public init(codeReviewArn: String, reactions: [Reaction], recommendationId: String) {
            self.codeReviewArn = codeReviewArn
            self.reactions = reactions
            self.recommendationId = recommendationId
        }

        public func validate(name: String) throws {
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, max: 1600)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, min: 1)
            try self.validate(self.codeReviewArn, name: "codeReviewArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:[a-z-]+:[\\w-]+$")
            try self.validate(self.reactions, name: "reactions", parent: name, max: 1)
            try self.validate(self.reactions, name: "reactions", parent: name, min: 0)
            try self.validate(self.recommendationId, name: "recommendationId", parent: name, max: 64)
            try self.validate(self.recommendationId, name: "recommendationId", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case codeReviewArn = "CodeReviewArn"
            case reactions = "Reactions"
            case recommendationId = "RecommendationId"
        }
    }

    public struct PutRecommendationFeedbackResponse: AWSDecodableShape {
        public init() {}
    }

    public struct RecommendationFeedback: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the  CodeReview  object.
        public let codeReviewArn: String?
        ///  The time at which the feedback was created.
        public let createdTimeStamp: Date?
        ///  The time at which the feedback was last updated.
        public let lastUpdatedTimeStamp: Date?
        ///  List for storing reactions. Reactions are utf-8 text code for emojis. You can send an empty list to clear off all your feedback.
        public let reactions: [Reaction]?
        ///  The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.
        public let recommendationId: String?
        ///  The ID of the user that made the API call.   The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see  Specifying a Principal in the AWS Identity and Access Management User Guide.
        public let userId: String?

        public init(codeReviewArn: String? = nil, createdTimeStamp: Date? = nil, lastUpdatedTimeStamp: Date? = nil, reactions: [Reaction]? = nil, recommendationId: String? = nil, userId: String? = nil) {
            self.codeReviewArn = codeReviewArn
            self.createdTimeStamp = createdTimeStamp
            self.lastUpdatedTimeStamp = lastUpdatedTimeStamp
            self.reactions = reactions
            self.recommendationId = recommendationId
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case codeReviewArn = "CodeReviewArn"
            case createdTimeStamp = "CreatedTimeStamp"
            case lastUpdatedTimeStamp = "LastUpdatedTimeStamp"
            case reactions = "Reactions"
            case recommendationId = "RecommendationId"
            case userId = "UserId"
        }
    }

    public struct RecommendationFeedbackSummary: AWSDecodableShape {
        ///  List for storing reactions. Reactions are utf-8 text code for emojis.
        public let reactions: [Reaction]?
        ///  The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.
        public let recommendationId: String?
        ///  The ID of the user that gave the feedback.   The UserId is an IAM principal that can be specified as an AWS account ID or an Amazon Resource Name (ARN). For more information, see  Specifying a Principal in the AWS Identity and Access Management User Guide.
        public let userId: String?

        public init(reactions: [Reaction]? = nil, recommendationId: String? = nil, userId: String? = nil) {
            self.reactions = reactions
            self.recommendationId = recommendationId
            self.userId = userId
        }

        private enum CodingKeys: String, CodingKey {
            case reactions = "Reactions"
            case recommendationId = "RecommendationId"
            case userId = "UserId"
        }
    }

    public struct RecommendationSummary: AWSDecodableShape {
        ///  A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line and the end line.
        public let description: String?
        ///  Last line where the recommendation is applicable in the source commit or source branch. For a single line comment the start line and end line values are the same.
        public let endLine: Int?
        /// Name of the file on which a recommendation is provided.
        public let filePath: String?
        ///  The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect the feedback.
        public let recommendationId: String?
        ///  Start line from where the recommendation is applicable in the source commit or source branch.
        public let startLine: Int?

        public init(description: String? = nil, endLine: Int? = nil, filePath: String? = nil, recommendationId: String? = nil, startLine: Int? = nil) {
            self.description = description
            self.endLine = endLine
            self.filePath = filePath
            self.recommendationId = recommendationId
            self.startLine = startLine
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case endLine = "EndLine"
            case filePath = "FilePath"
            case recommendationId = "RecommendationId"
            case startLine = "StartLine"
        }
    }

    public struct Repository: AWSEncodableShape {
        ///  Information about a Bitbucket repository.
        public let bitbucket: ThirdPartySourceRepository?
        /// Information about an AWS CodeCommit repository.
        public let codeCommit: CodeCommitRepository?
        ///  Information about a GitHub Enterprise Server repository.
        public let gitHubEnterpriseServer: ThirdPartySourceRepository?

        public init(bitbucket: ThirdPartySourceRepository? = nil, codeCommit: CodeCommitRepository? = nil, gitHubEnterpriseServer: ThirdPartySourceRepository? = nil) {
            self.bitbucket = bitbucket
            self.codeCommit = codeCommit
            self.gitHubEnterpriseServer = gitHubEnterpriseServer
        }

        public func validate(name: String) throws {
            try self.bitbucket?.validate(name: "\(name).bitbucket")
            try self.codeCommit?.validate(name: "\(name).codeCommit")
            try self.gitHubEnterpriseServer?.validate(name: "\(name).gitHubEnterpriseServer")
        }

        private enum CodingKeys: String, CodingKey {
            case bitbucket = "Bitbucket"
            case codeCommit = "CodeCommit"
            case gitHubEnterpriseServer = "GitHubEnterpriseServer"
        }
    }

    public struct RepositoryAnalysis: AWSEncodableShape {
        ///  A  SourceCodeType  that specifies the tip of a branch in an associated repository.
        public let repositoryHead: RepositoryHeadSourceCodeType

        public init(repositoryHead: RepositoryHeadSourceCodeType) {
            self.repositoryHead = repositoryHead
        }

        public func validate(name: String) throws {
            try self.repositoryHead.validate(name: "\(name).repositoryHead")
        }

        private enum CodingKeys: String, CodingKey {
            case repositoryHead = "RepositoryHead"
        }
    }

    public struct RepositoryAssociation: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) identifying the repository association.
        public let associationArn: String?
        /// The ID of the repository association.
        public let associationId: String?
        ///  The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see  Connection  in the AWS CodeStar Connections API Reference.
        public let connectionArn: String?
        /// The time, in milliseconds since the epoch, when the repository association was created.
        public let createdTimeStamp: Date?
        /// The time, in milliseconds since the epoch, when the repository association was last updated.
        public let lastUpdatedTimeStamp: Date?
        /// The name of the repository.
        public let name: String?
        /// The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository.
        public let owner: String?
        /// The provider type of the repository association.
        public let providerType: ProviderType?
        /// The state of the repository association. The valid repository association states are:    Associated: The repository association is complete.     Associating: CodeGuru Reviewer is:     Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.    If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.      Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.       Failed: The repository failed to associate or disassociate.     Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.     Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in an associated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.
        public let state: RepositoryAssociationState?
        /// A description of why the repository association is in the current state.
        public let stateReason: String?

        public init(associationArn: String? = nil, associationId: String? = nil, connectionArn: String? = nil, createdTimeStamp: Date? = nil, lastUpdatedTimeStamp: Date? = nil, name: String? = nil, owner: String? = nil, providerType: ProviderType? = nil, state: RepositoryAssociationState? = nil, stateReason: String? = nil) {
            self.associationArn = associationArn
            self.associationId = associationId
            self.connectionArn = connectionArn
            self.createdTimeStamp = createdTimeStamp
            self.lastUpdatedTimeStamp = lastUpdatedTimeStamp
            self.name = name
            self.owner = owner
            self.providerType = providerType
            self.state = state
            self.stateReason = stateReason
        }

        private enum CodingKeys: String, CodingKey {
            case associationArn = "AssociationArn"
            case associationId = "AssociationId"
            case connectionArn = "ConnectionArn"
            case createdTimeStamp = "CreatedTimeStamp"
            case lastUpdatedTimeStamp = "LastUpdatedTimeStamp"
            case name = "Name"
            case owner = "Owner"
            case providerType = "ProviderType"
            case state = "State"
            case stateReason = "StateReason"
        }
    }

    public struct RepositoryAssociationSummary: AWSDecodableShape {
        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let associationArn: String?
        ///  The repository association ID.
        public let associationId: String?
        ///  The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see  Connection  in the AWS CodeStar Connections API Reference.
        public let connectionArn: String?
        /// The time, in milliseconds since the epoch, since the repository association was last updated.
        public let lastUpdatedTimeStamp: Date?
        /// The name of the repository association.
        public let name: String?
        /// The owner of the repository. For an AWS CodeCommit repository, this is the AWS account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository.
        public let owner: String?
        /// The provider type of the repository association.
        public let providerType: ProviderType?
        /// The state of the repository association. The valid repository association states are:    Associated: The repository association is complete.     Associating: CodeGuru Reviewer is:     Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review.    If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered.      Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository.       Failed: The repository failed to associate or disassociate.     Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access.     Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in an associated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide.
        public let state: RepositoryAssociationState?

        public init(associationArn: String? = nil, associationId: String? = nil, connectionArn: String? = nil, lastUpdatedTimeStamp: Date? = nil, name: String? = nil, owner: String? = nil, providerType: ProviderType? = nil, state: RepositoryAssociationState? = nil) {
            self.associationArn = associationArn
            self.associationId = associationId
            self.connectionArn = connectionArn
            self.lastUpdatedTimeStamp = lastUpdatedTimeStamp
            self.name = name
            self.owner = owner
            self.providerType = providerType
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case associationArn = "AssociationArn"
            case associationId = "AssociationId"
            case connectionArn = "ConnectionArn"
            case lastUpdatedTimeStamp = "LastUpdatedTimeStamp"
            case name = "Name"
            case owner = "Owner"
            case providerType = "ProviderType"
            case state = "State"
        }
    }

    public struct RepositoryHeadSourceCodeType: AWSEncodableShape & AWSDecodableShape {
        ///  The name of the branch in an associated repository. The RepositoryHeadSourceCodeType specifies the tip of this branch.
        public let branchName: String

        public init(branchName: String) {
            self.branchName = branchName
        }

        public func validate(name: String) throws {
            try self.validate(self.branchName, name: "branchName", parent: name, max: 256)
            try self.validate(self.branchName, name: "branchName", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case branchName = "BranchName"
        }
    }

    public struct SourceCodeType: AWSDecodableShape {
        ///  A  SourceCodeType  that specifies a commit diff created by a pull request on an associated repository.
        public let commitDiff: CommitDiffSourceCodeType?
        public let repositoryHead: RepositoryHeadSourceCodeType?

        public init(commitDiff: CommitDiffSourceCodeType? = nil, repositoryHead: RepositoryHeadSourceCodeType? = nil) {
            self.commitDiff = commitDiff
            self.repositoryHead = repositoryHead
        }

        private enum CodingKeys: String, CodingKey {
            case commitDiff = "CommitDiff"
            case repositoryHead = "RepositoryHead"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn"))
        ]

        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let resourceArn: String
        ///  An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts:    A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive.   An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
        public let tags: [String: String]

        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ThirdPartySourceRepository: AWSEncodableShape {
        ///  The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see  Connection  in the AWS CodeStar Connections API Reference.
        public let connectionArn: String
        ///  The name of the third party source repository.
        public let name: String
        ///  The owner of the repository. For a GitHub, GitHub Enterprise, or Bitbucket repository, this is the username for the account that owns the repository.
        public let owner: String

        public init(connectionArn: String, name: String, owner: String) {
            self.connectionArn = connectionArn
            self.name = name
            self.owner = owner
        }

        public func validate(name: String) throws {
            try self.validate(self.connectionArn, name: "connectionArn", parent: name, max: 256)
            try self.validate(self.connectionArn, name: "connectionArn", parent: name, min: 0)
            try self.validate(self.connectionArn, name: "connectionArn", parent: name, pattern: "arn:aws(-[\\w]+)*:.+:.+:[0-9]{12}:.+")
            try self.validate(self.name, name: "name", parent: name, max: 100)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^\\S[\\w.-]*$")
            try self.validate(self.owner, name: "owner", parent: name, max: 100)
            try self.validate(self.owner, name: "owner", parent: name, min: 1)
            try self.validate(self.owner, name: "owner", parent: name, pattern: "^\\S(.*\\S)?$")
        }

        private enum CodingKeys: String, CodingKey {
            case connectionArn = "ConnectionArn"
            case name = "Name"
            case owner = "Owner"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "resourceArn", location: .uri(locationName: "resourceArn")),
            AWSMemberEncoding(label: "tagKeys", location: .querystring(locationName: "tagKeys"))
        ]

        ///  The Amazon Resource Name (ARN) of the  RepositoryAssociation  object. You can retrieve this ARN by calling  ListRepositoryAssociations .
        public let resourceArn: String
        /// A list of the keys for each tag you want to remove from an associated repository.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[^:\\s]*:codeguru-reviewer:[^:\\s]+:[\\d]{12}:association:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }
}
